package util;

import java.sql.DriverManager;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;

public final class ConnectionFactory {

	private ConnectionFactory(){}
	
	public static Connection getConnection() throws SQLException{
		
		try{
			Class.forName("com.mysql.jdbc.Driver");
			Connection conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/juridico","root","");
	    
			return conn;
		
		}catch(Exception ex){
			ex.printStackTrace();
			throw new SQLException(ex.getMessage());
			
		}
	}
	
}
